{% extends "base.html" %}

{% block title %}编辑配置 - 交易监控系统{% endblock %}

{% block content %}
<div class="page-header">
    <h1>编辑配置</h1>
    <a href="/config" class="btn btn-secondary">
        <i class="fas fa-arrow-left"></i> 返回列表
    </a>
</div>

<div class="card">
    <div class="card-header">
        <h2>配置信息</h2>
    </div>
    <div class="card-body">
        <form action="/config/{{ config.id }}/edit" method="post">
            <div class="form-group">
                <label for="key">配置键</label>
                <input type="text" id="key" name="key" class="form-control" value="{{ config.key }}" readonly>
            </div>
            
            <div class="form-group">
                <label for="description">描述</label>
                <input type="text" id="description" name="description" class="form-control" value="{{ config.description }}" readonly>
            </div>
            
            <div class="form-group">
                <label for="value">配置值</label>
                {% if config.value == 'on' or config.value == 'off' %}
                <select id="value" name="value" class="form-control" required>
                    <option value="on" {% if config.value == 'on' %}selected{% endif %}>开启</option>
                    <option value="off" {% if config.value == 'off' %}selected{% endif %}>关闭</option>
                </select>
                {% else %}
                <input type="text" id="value" name="value" class="form-control" value="{{ config.value }}" required>
                {% endif %}
            </div>
            
            <button type="submit" class="btn btn-primary">
                <i class="fas fa-save"></i> 保存
            </button>
        </form>
    </div>
</div>
{% endblock %}